#ifndef RENDERTECHTYPE_H
#define RENDERTECHTYPE_H
#include "RenderTech.h"
#include "RenderTechMacro.h"
#include "RenderTechFactory.h"
struct RenderTechType
{
	RenderTech* m_pTech;
	enum RENDERTECHTYPE m_iType;

	RenderTechType()
	{
		m_pTech = NULL;
		m_iType = TRENDERDEFAULT;
	}
	RenderTechType(enum RENDERTECHTYPE iType)
	{		
		m_pTech = CRenderTechFactory::GetRenderTechnique(iType);
		m_iType = iType;
	}
	~RenderTechType()
	{
		SAFE_DELETE(m_pTech);
	}	
	void SetRenderType(enum RENDERTECHTYPE iType)
	{
		SAFE_DELETE(m_pTech);
		m_pTech = CRenderTechFactory::GetRenderTechnique(m_iType);
		m_iType = iType;
	}

	RenderTechType& operator=(RenderTechType const &rhs) {
		if(this != &rhs){
			SAFE_DELETE(m_pTech); // free resource;
			this->m_pTech = CRenderTechFactory::GetRenderTechnique(rhs.m_iType);
			this->m_iType = rhs.m_iType;
		}
		return *this;
	}
};
#endif